<form class="layui-form layui-form-pane" action="{:url()}" method="post" id="editForm">
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 150px">班级名称</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-name" lay-verify="required" autocomplete="off"
                   placeholder="请输入班级名称" readonly>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 150px">Token名称</label>
        <div class="layui-input-inline">
            <input type="text" data-disabled class="layui-input field-currency_name" name="currency_name" autocomplete="off"
                   placeholder="请输入Token名称">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 150px">Token简称</label>
        <div class="layui-input-inline">
            <input type="text" data-disabled class="layui-input field-currency_mark" name="currency_mark" autocomplete="off"
                   placeholder="请输入Token简称">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 150px">LOGO</label>
        <div class="layui-input-inline upload">
            <button type="button" name="upload" class="layui-btn layui-btn-primary layui-upload" lay-type="image" lay-data="{exts:'{:str_replace(',', '|', config('upload.upload_image_ext'))}', accept:'image'}">请上传LOGO</button>
            <input type="hidden" class="upload-input" name="logo" value="{$info['logo']}">
            {if condition="$info['logo']"}
            <img src="{$info['logo']}" style="display:inline-block;border-radius:5px;border:1px solid #ccc" width="36" height="36">
            {else /}
            <img src="" style="display:none;border-radius:5px;border:1px solid #ccc" width="36" height="36">
            {/if}
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 150px">提现手续费(%)</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-fee" name="fee" autocomplete="off"
                   placeholder="请输入手续费">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 150px">Token数量</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-currency_all_num" name="currency_all_num" autocomplete="off"
                   placeholder="请输入Token数量">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 150px">Token合约地址</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-contract_address" name="contract_address" autocomplete="off"
                   placeholder="请输入Token合约地址">
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" name="id" class="field-id"/>
            <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formSubmit">提交</button>
            <a href="{:url('token')}" class="layui-btn layui-btn-primary ml10"><i class="aicon ai-fanhui"></i>返回</a>
        </div>
    </div>
</form>
{include file="block/layui" /}
<script>
    var formData = {:json_encode($info)};
</script>
<script>
    layui.use(['jquery', 'laydate', 'upload'], function() {
        var $ = layui.jquery, laydate = layui.laydate, layer = layui.layer, upload = layui.upload;
        upload.render({
            elem: '.layui-upload',
            url: '{:url("admin/annex/upload?thumb=no&water=no&group=currency")}'
            ,method: 'post'
            ,before: function(input) {
                layer.msg('文件上传中...', {time:3000000});
            },done: function(res, index, upload) {
                var obj = this.item;
                if (res.code == 0) {
                    layer.msg(res.msg);
                    return false;
                }
                layer.closeAll();
                var input = $(obj).parents('.upload').find('.upload-input');
                if ($(obj).attr('lay-type') == 'image') {
                    input.siblings('img').attr('src', res.data.file).show();
                }
                input.val(res.data.file);
            }
        });
        // 日期渲染
        laydate.render({elem: '.layui-date'});
    });
</script>
<script src="__ADMIN_JS__/footer.js"></script>